!function(e){var t={};function i(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};e[n].call(s.exports,s,s.exports,i);s.l=!0;return s.exports}i.m=e;i.c=t;i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})};i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});Object.defineProperty(e,"__esModule",{value:!0})};i.t=function(e,t){1&t&&(e=i(e));if(8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);i.r(n);Object.defineProperty(n,"default",{enumerable:!0,value:e});if(2&t&&"string"!=typeof e)for(var s in e)i.d(n,s,function(t){return e[t]}.bind(null,s));return n};i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};i.d(t,"a",t);return t};i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};i.p="//static.hsappstatic.net/web-interactives-embed/static-2.995/";i(i.s=21)}([function(e,t,i){"use strict";var n=i(1);i.d(t,"MessageTypes",(function(){return n.a}));var s=i(2);i.d(t,"setStyleOnElement",(function(){return s.a}));var o=i(22);i.d(t,"GlobalIframeCommunication",(function(){return o.a}));i.d(t,"createEventEmitter",(function(){return o.b}));i.d(t,"createFrameComponent",(function(){return o.c}));var r=i(6);i.d(t,"Store",(function(){return r.a}));i(23);var a=i(24);i.d(t,"ParentApplicationController",(function(){return a.a}));var c=i(10);i.o(c,"createElementObserver")&&i.d(t,"createElementObserver",(function(){return c.createElementObserver}));i.o(c,"createQueue")&&i.d(t,"createQueue",(function(){return c.createQueue}));i.o(c,"filterMap")&&i.d(t,"filterMap",(function(){return c.filterMap}));i.o(c,"isSameUrlExceptAnchor")&&i.d(t,"isSameUrlExceptAnchor",(function(){return c.isSameUrlExceptAnchor}));i.o(c,"listenForEscPress")&&i.d(t,"listenForEscPress",(function(){return c.listenForEscPress}));i.o(c,"mergeMaps")&&i.d(t,"mergeMaps",(function(){return c.mergeMaps}));i.o(c,"navigatePage")&&i.d(t,"navigatePage",(function(){return c.navigatePage}));i.o(c,"sortMap")&&i.d(t,"sortMap",(function(){return c.sortMap}));i.o(c,"throttle")&&i.d(t,"throttle",(function(){return c.throttle}));var l=i(7);i.d(t,"createQueue",(function(){return l.a}));i(8);var h=i(11);i.d(t,"createElementObserver",(function(){return h.a}));var d=i(12);i.d(t,"filterMap",(function(){return d.a}));i.d(t,"mergeMaps",(function(){return d.b}));i.d(t,"sortMap",(function(){return d.c}));var u=i(9);i.d(t,"navigatePage",(function(){return u.a}));var m=i(13);i.d(t,"listenForEscPress",(function(){return m.a}));var g=i(5);i.d(t,"isSameUrlExceptAnchor",(function(){return g.c}));var p=i(14);i.d(t,"throttle",(function(){return p.a}));i(15)},function(e,t,i){"use strict";const n={RECEIVED_ANALYTICS:"HS_CTA_PARENT_RECEIVED_ANALYTICS",DEVICE_TYPE:"HS_CTA_PARENT_DEVICE_TYPE",PROXY_ANALYTICS_FN_CALLBACK:"HS_CTA_PARENT_PROXY_ANALYTICS_FN",INIT:"HS_CTA_PARENT_INIT",SHOWING_CTA:"HS_CTA_SHOWING_CTA",STARTED:"HS_CTA_STARTED",NAVIGATE_PAGE:"HS_CTA_NAVIGATE_PAGE",CLICK_EVENT:"HS_CTA_CLICK_EVENT",CLOSE_INTERACTIVE:"HS_CTA_CLOSE_INTERACTIVE",HAS_CLOSED:"HS_CTA_HAS_CLOSED",NEW_HEIGHT:"HS_CTA_NEW_HEIGHT",DISPLAY_CALL_TO_ACTION:"HS_DISPLAY_CALL_TO_ACTION",PROXY_ANALYTICS:"HS_CTA_PROXY_ANALYTICS",PROXY_ANALYTICS_FN:"HS_CTA_PROXY_ANALYTICS_FN",SEND_FORM_DEFINITION:"HS_SEND_FORM_DEFINITION",SEND_CTA_CONFIG:"HS_SEND_CTA_CONFIG",SEND_EMBED_CONTEXT:"HS_SEND_EMBED_CONTEXT",RECEIVE_FILTERED_STYLESHEETS:"RECEIVE_FILTERED_STYLESHEETS",SEND_STYLESHEETS:"SEND_STYLESHEETS",RENDER_RECAPTCHA:"RENDER_RECAPTCHA",EXECUTE_RECAPTCHA:"EXECUTE_RECAPTCHA",RESET_RECAPTCHA:"RESET_RECAPTCHA",RECAPTCHA_SUCCESS:"RECAPTCHA_SUCCESS",RECAPTCHA_EXPIRED:"RECAPTCHA_EXPIRED",TRIGGER_CTA:"HS_CTA_TRIGGER_CTA",CTA_FORM_SUBMITTED:"HS_CTA_FORM_SUBMITTED"};t.a=n},function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));function n(e,t={}){for(const i in t)Object.hasOwnProperty.call(t,i)&&(e.style[i]=t[i])}},function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));function n(...e){if(window.location.search.indexOf("hs_debug_interactive")>-1||window.location.host.includes("local.hsappstatic")){console.log("[web-interactives-embed]",...e);window.location.search.indexOf("hs_is_selenium")>-1&&console.log(...[...e].map(e=>JSON.stringify(e)))}}},function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));class n{constructor(){this.listeners=new Map}on(e,t){if(!this.listeners.has(e)){this.listeners.set(e,[t]);return}const i=this.listeners.get(e);this.listeners.set(e,[...i,t])}off(e){this.listeners.delete(e)}emit(e,t){const i=this.listeners.get(e);i&&i.length&&i.forEach(e=>e(t))}reset(){this.listeners=new Map}}function s(){return new n}},function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));i.d(t,"b",(function(){return s}));i.d(t,"c",(function(){return o}));function n(e,t,i){e.startsWith("http")||(e="https://"+e);const n=new URL(e);n.searchParams.set(t,i);return n.href}function s(e,t){e.startsWith("http")||(e="https://"+e);if(0===Object.keys(t).length)return e;const i=new URL(e);Object.keys(t).forEach(e=>i.searchParams.set(e,t[e]));return i.href}function o(e,t){return e.replace(/#.*$/,"")===t.replace(/#.*$/,"")}},function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));class n{constructor(e,t){this.listeners=new Set;this.batching=!1;this.queue=[];this.subscribe=e=>{this.listeners.add(e);let t=()=>{};this.options&&this.options.onSubscribe&&(t=this.options.onSubscribe(e,this));return()=>{this.listeners.delete(e);t()}};this.setState=e=>{const t=this.state;this.options&&this.options.updateFn?this.state=this.options.updateFn(t)(e):this.state=e(t);if(this.state!==t){this.queue.push(()=>{this.listeners.forEach(e=>e(this.state,t));this.options&&this.options.onUpdate&&this.options.onUpdate(this.state,t)});this._flush()}};this._flush=()=>{if(!this.batching){this.queue.forEach(e=>e());this.queue=[]}};this.batch=e=>{this.batching=!0;e();this.batching=!1;this._flush()};this.state=e;this.options=t}}},function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));class n{constructor(){this.storage=[]}enqueue(e){this.storage.push(e)}dequeue(){return this.storage.shift()}peek(){return this.storage[0]}size(){return this.storage.length}}function s(){return new n}},function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));function n(e){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()}},function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));function n(e,t=!1){if(t){const t=window.open(e,"_blank");t?t.focus():window.location.assign(e)}else window.location.assign(e)}},function(e,t){},function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));class n{constructor(){this.handleIntersection=e=>{e.forEach(e=>{if(e.isIntersecting){const t=e.target;this.onElementAppear(t);this.observedElements.delete(t);this.observer.unobserve(t)}})};this.observer=new IntersectionObserver(this.handleIntersection,{threshold:.5});this.observedElements=new Map}onElementAppear(e){const t=this.observedElements.get(e);t&&t(e)}observe(e,t){if((()=>{const t=e.getBoundingClientRect(),i=window.innerHeight;return t.bottom>=0&&t.topt(i,e));return new Map(i)}function s(e,t){const i=[...e].sort(([e,i],[n,s])=>t(i,s));return new Map(i)}function o(e,t){const i=new Map(e);for(const[e,n]of t)i.set(e,n);return i}},function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));function n(e){const t=t=>{"Escape"===t.key&&e()};document.addEventListener("keydown",t);return()=>{document.removeEventListener("keydown",t)}}},function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));function n(e,t){let i,n=0;return function(){const s=this,o=arguments,r=Date.now();if(r-n>=t){i&&window.clearTimeout(i);e.apply(s,o);n=r}else i||(i=window.setTimeout(()=>{e.apply(s,o);n=Date.now();i=void 0},t))}}},function(e,t,i){"use strict";i(3)},function(e,t,i){"use strict";var n=i(25);i.d(t,"createTrigger",(function(){return n.a}));i(17)},function(e,t){},,,,function(e,t,i){"use strict";i.r(t);var n=i(0),s=i(3);const o={BANNER:"BANNER",MODAL:"MODAL",SLIDE_IN:"SLIDE_IN",EMBEDDED:"EMBEDDED"};var r=i(5);const a=["previewInteractiveId","preview_web_interactive","preview_key","_preview","portalId","hs_preview"];function c(){const e=new URLSearchParams(window.location.search),t={};e.forEach((e,i)=>{a.includes(i)||(t[i]=e)});return t}function l({contentId:e,portalId:t,env:i,hublet:n,useSameOrigin:s=!1}){const o="qa"===i?"qa":"",r="na1"===n?"":"-"+n,a=document.location.protocol;return s?`${window.location.origin}/hs-web-interactive-${t}-${e}`:`${a}//${t}.hs-sites${o}${r}.com/hs-web-interactive-${t}-${e}`}function h(e,t,i){let n={};t.contactPreviewEmail&&(n.email=t.contactPreviewEmail);const s=i.analytics&&i.analytics.hutk;s&&(n.utk=s);window.location.search.includes("hs_debug_interactive")&&(n.hs_debug_interactive="true");if(t.isUngatedFor("WebInteractives:FormsPassThroughParams")){const e=c();n=Object.assign({},e,{},n)}return Object(r.b)(e,n)}function d(e,t){if(null==e)return{};var i,n,s={},o=Object.keys(e);for(n=0;n=0||(s[i]=e[i])}return s}function u(e,t){t.hutk&&e.searchParams.set("utk",""+t.hutk);t.hstc&&e.searchParams.set("__hstc",""+t.hstc);t.hssc&&e.searchParams.set("__hssc",""+t.hssc);t.referrer&&e.searchParams.set("referrer",""+t.referrer);t.pageId&&e.searchParams.set("contentId",t.pageId)}function m({contentIds:e,currentUrl:t,isPreview:i,portalId:n,env:s,hublet:o="na1",versionId:r,analytics:a,extraParams:c,path:l}){const h="qa"===s?"qa":"";let d="";d=window.location.search.includes("useLocalPublicService")?"https://local.hubspotqa.com/web-interactives/public/v1/"+l:"na1"===o?`https://cta-service-cms2.hubspot${h}.com/web-interactives/public/v1/${l}`:`https://cta-${o}.hubspot${h}.com/web-interactives/public/v1/${l}`;const m=new URL(d);i&&m.searchParams.set("isPreview","true");e&&e.length&&e.forEach(e=>m.searchParams.append("contentIds",""+e));n&&m.searchParams.set("portalId",""+n);t&&!i&&m.searchParams.set("currentUrl",t);r&&m.searchParams.set("versionId",""+r);a&&!i&&u(m,a);c&&Object.keys(c).forEach(e=>m.searchParams.set(e,""+c[e]));return m.href}const g="embed/combinedConfigs",p="embed/templateConfig";function f(e){let{previewScheduled:t,templatePath:i,isMobile:n}=e,s=d(e,["previewScheduled","templatePath","isMobile"]),o="";o=i?p:g;const r={};t&&(r.previewScheduled="true");i&&(r.templatePath=i);n&&(r.isMobile="true");return m(Object.assign({},s,{extraParams:r,path:o}))}const v={TOP:"TOP",BOTTOM:"BOTTOM",TOP_LEFT:"TOP_LEFT",TOP_RIGHT:"TOP_RIGHT",BOTTOM_LEFT:"BOTTOM_LEFT",BOTTOM_RIGHT:"BOTTOM_RIGHT"},C=(e,t=1)=>{if(!e)return{r:null,g:null,b:null,a:t};if(3===(e=e.replace("#","")).length){const t=e.split("").reduce((e,t)=>e+t+t,"");e=t}return{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:t}},T=(e,t=1)=>{const i=C(e,t);return`rgba(${i.r}, ${i.g}, ${i.b}, ${i.a})`};class b{constructor(){this.fetchConfigs=()=>{const e=this.store.state.configRequest;if(!e)return Promise.resolve(null);const t=f(e);return this.fetch(t)};this.handleFetchFailed=()=>{this.store.setState(e=>Object.assign({},e,{requestError:!0}))};this.handleFetchSucceded=({sortedAudienceConfigs:e,requestedConfigs:t})=>{const i=structuredClone(this.configs);e&&e.length&&e.forEach(e=>i.set(e.contentModelId,e));t&&t.length&&t.forEach(e=>{i.has(e.contentModelId)||i.set(e.contentModelId,e)});this.store.setState(e=>Object.assign({},e,{configs:i,isLoaded:!0}))};this.handleTemplateSucceded=e=>{this.store.setState(t=>Object.assign({},t,{templateConfig:e,isLoaded:!0}))};const e={configs:new Map,configRequest:null,requestError:!1,isLoaded:!1};this.store=new n.Store(e)}init(e){this.store.setState(t=>Object.assign({},t,{configRequest:e}));return this.fetchConfigs()}subscribe(e){return this.store.subscribe(e)}get configs(){return this.store.state.configs}get isLoaded(){return this.store.state.isLoaded}get sortedConfigsWithSpecificty(){return Object(n.sortMap)(this.configsWithAudience,(e,t)=>t.specificity-e.specificity)}get configsWithAudience(){return Object(n.filterMap)(this.configs,e=>e.specificity>0)}get overlayedConfigsWithNoAudience(){return Object(n.filterMap)(this.overlayedConfigs,e=>!e.specificity)}get overlayedConfigs(){return Object(n.filterMap)(this.configs,e=>e.containerType!==o.EMBEDDED)}get embeddedConfigs(){const e=Object(n.filterMap)(this.configs,e=>e.containerType===o.EMBEDDED);this.templateConfig&&this.templateConfig.containerType===o.EMBEDDED&&e.set(1,this.templateConfig);return e}get templateConfig(){return this.store.state.templateConfig}get previewConfig(){const[e]=this.store.state.configs.values();return e}fetch(e){return fetch(e).then(e=>{if(!e.ok){this.handleFetchFailed();return Promise.resolve(null)}return e.json().then(e=>{e.templatePath?this.handleTemplateSucceded(e):this.handleFetchSucceded(e);return e}).catch(this.handleFetchFailed)}).catch(this.handleFetchFailed)}fetchConfigsWithIds(e){const t=this.store.state.configRequest;if(!t)return;const i=f(Object.assign({},t,{contentIds:e}));this.fetch(i)}static getStylesFromContainerStyles(e){let t=e.width.value||5,i=e.height.value||5;"px"===e.width.units&&(t=Math.max(t,5));"px"===e.height.units&&(i=Math.max(i,5));return{width:`${t}${e.width.units}`,height:`${i}${e.height.units}`}}static getStylesForIframe(e){const t={},{border:i,borderRadius:n,boxShadow:s}=e;i&&(t.border=`${i.width.value}${i.width.units} ${i.style} ${T(i.color,i.opacity/100)}`);s&&s.css&&(t.boxShadow=s.css.split(":")[1]);n&&(t.borderRadius=`${n.value}${n.units}`);return t}static isFloatingButtonLike(e){return"isDismissable"in e&&(e.containerType===o.SLIDE_IN&&!e.isDismissable)}static isTopBannerLike(e){return e.containerType===o.BANNER&&e.containerStyles.position===v.TOP}}var y=new b;const w=()=>document.getElementById("hubspot-web-interactives-loader"),E=(e,t)=>{if(!t)return null;const i=t.getAttribute(e);return i||null},S=e=>{const t=E("data-hsjs-portal",e);return t?parseInt(t,10):null},A=e=>{const t=E("data-hsjs-env",e);return t||"prod"},I=e=>{const t=E("data-hsjs-hublet",e);return t||"na1"},M=e=>{const t=E("data-hsjs-local",e);return!!t&&"true"===t},O=e=>E("src",e),P=()=>{const e=w();return e?{portalId:S(e),env:A(e),hublet:I(e),isLocal:M(e),src:O(e)}:null},_=()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),F=["hs_preview","preview_key"];class L{constructor(){this.portalId=0;this.env="";this.hublet="na1";this.isLocal=!1;this.isMobile=!1;this.isLiveHSPage=!1;this.pageId=null;this.language=null;this.isPreview=!1;this.isScreenshot=!1;this.isTemplate=!1;this.previewScheduled=!1;this.currentUrl=window.location.href;this.enableResponsiveStyles=!1;this.isPreviewPage=!1;this.gates=[]}init(){this._setEnvProps();this._setUrlProps()}static getPageId(){return window.hsVars&&window.hsVars.analytics_page_id?window.hsVars.analytics_page_id:window.hsVars&&window.hsVars.page_id?window.hsVars.page_id:null}static getLanguage(){const e=window.hsVars;return e&&e.language?e.language:null}_setEnvProps(){const e=P();this.portalId=e.portalId;this.hublet=e.hublet;this.env=e.env;this.isLocal=e.isLocal;this.isMobile=_();this.isPreviewPage=F.some(e=>window.location.search.includes(e));this.pageId=L.getPageId();this.isLiveHSPage=Boolean(this.pageId);this.language=L.getLanguage()}isCosPreviewPage(){const e=window.location.toString();return/preview(-[^.]+)?\.hs-sites(qa)?(-[^.]+)?\.com/g.test(e)||/hubspotpreview(qa)?(-[^.]+)?/.test(e)||window.location.search.includes("hs_preview")||window.location.search.includes("preview_key")}isCos(){if(window.hsVars&&window.hsVars.portal_id)return!0;return[...document.getElementsByTagName("meta")].some(e=>"generator"===e.getAttribute("name")&&"HubSpot"===e.getAttribute("content"))}_setUrlProps(){const e=new URLSearchParams(window.location.search);if(e.has("templatePath")){this.templatePath=e.get("templatePath");this.isTemplate=!0}e.has("previewScheduled")&&(this.previewScheduled="true"===e.get("previewScheduled"));e.has("enableResponsiveStyles")&&(this.enableResponsiveStyles="true"===e.get("enableResponsiveStyles"));e.has("versionId")&&(this.versionId=parseInt(e.get("versionId"),10));if(e.has("screenshotBodyHeight")){this.screenshotBodyHeight=parseInt(e.get("screenshotBodyHeight"),10);this.isScreenshot=!0}if(e.has("publishedPreview")){this.isPreview=!0;this.previewScheduled=!0;this.versionId=-1}if(e.has("previewInteractiveId")){this.previewId=parseInt(e.get("previewInteractiveId"),10);this.isPreview=!0}this.isPreview&&e.has("email")&&(this.contactPreviewEmail=e.get("email"))}setGates(e){this.gates=e}isUngatedFor(e){return this.gates.includes(e)}}var R=new L;class N{constructor(){this.markAsViewed=e=>{this.store.setState(t=>Object.assign({},t,{viewed:new Set([...t.viewed,e])}))};const e={viewed:new Set};this.store=new n.Store(e)}subscribe(e){this.store.subscribe(e)}hasBeenViewed(e){return this.store.state.viewed.has(e)}get viewed(){return this.store.state.viewed}}function k(){return new N}const H="hs-cta-trigger-button",D="hs-cta-embed",B="web-interactives-preview-wrapper";var x=()=>Array.from(document.getElementsByClassName(H));var V=()=>Array.from(document.getElementsByClassName(D));const j=()=>{try{return Array.from(document.querySelectorAll("a[href*='HS_DISPLAY_CALL_TO_ACTION'"))}catch(e){return[]}},$=e=>{const t=e.getAttribute("href");if(!t)return null;const i=/\(([^)]+)\)/.exec(t);if(!i)return null;const n=i[1];return n?JSON.parse(n.replace(/(['"])?([a-z0-9A-Z_]+)(['"])?:/g,'"$2": ').replaceAll("'",'"')).id:null};var U=e=>{const t=Array.from(e.classList).filter(e=>e.startsWith(H)&&e!==H||e.startsWith(D)&&e!==D).map(e=>e.split("-").pop());let i=Number(t);if(Number.isNaN(i)){const t=e.dataset.hubspotWrapperCtaId;i=Number(t)}return i};function G(e){return Number(e.dataset.hubspotWrapperCtaId)}function q(){return Array.from(document.querySelectorAll(".hs-web-interactive-inline[data-hubspot-wrapper-cta-id]"))}const W=()=>{const e=new Map,t=new Map,i=new Map,n=new Set,s=new Set,o=new Set;x().forEach(t=>{const i=U(t);n.add(i);const s=e.get(i);s?e.set(i,[...s,t]):e.set(i,[t])});V().forEach(e=>{const i=U(e);s.add(i);const n=t.get(i);n?t.set(i,[...n,e]):t.set(i,[e])});j().forEach(t=>{const i=$(t);if(!i)return;n.add(i);const s=e.get(i);s?e.set(i,[...s,t]):e.set(i,[t])});q().forEach((e,t)=>{const n=G(e);if(!n)return;e.id=`hs-interactive-container-${n}-${t}`;o.add(n);const s=i.get(n);s?i.set(n,[...s,e]):i.set(n,[e])});const r=[...new Set([...n,...s,...o])];return{clickTriggerButtons:e,embedContainers:t,nonFramedCTAContainers:i,clickTriggerIds:n,embedIds:s,nonFramedIds:o,uniqueIds:r}},z=(e,t)=>{const i=document.createElement("div");i.innerHTML=t;return i.firstElementChild};let Y={data:""},Q=e=>{try{let t=e?e.querySelector("#_goober"):self._goober;return t||(t=(e||document.head).appendChild(document.createElement("style")),t.innerHTML=" ",t.id="_goober"),t.firstChild}catch(e){}return Y},X=/(?:([a-z0-9-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(})/gi,K=/\/\*.*?\*\/|\s{2,}|\n/gm,J=(e,t,i)=>{let n="",s="",o="";for(let r in e){let a=e[r];if("object"==typeof a){let e=t+" "+r;/&/g.test(r)&&(e=r.replace(/&/g,t)),"@"==r[0]&&(e=t,"f"==r[1]&&(e=r)),/@k/.test(r)?s+=r+"{"+J(a,"","")+"}":s+=J(a,e,e==t?r:i||"")}else/^@i/.test(r)?n=r+" "+a+";":o+=J.p?J.p(r.replace(/[A-Z]/g,"-$&").toLowerCase(),a):r.replace(/[A-Z]/g,"-$&").toLowerCase()+":"+a+";"}if(o[0]){let e=t+"{"+o+"}";return i?s+i+"{"+e+"}":n+e+s}return n+s},Z={},ee=(e,t,i,n)=>{let s=e.toLowerCase?e:function e(t){let i="";for(let n in t)"object"==typeof val?i+=n+e(t[n]):i+=n+t[n];return i}(e),o=Z[s]||(Z[s]=".go"+s.split("").reduce((e,t)=>101*e+t.charCodeAt(0)>>>0,11));return((e,t,i)=>{t.data.indexOf(e)<0&&(t.data=i?e+t.data:t.data+e)})(Z[o]||(Z[o]=J(e[0]?(e=>{let t,i=[{}];for(;t=X.exec(e.replace(K,""));)t[4]&&i.shift(),t[3]?i.unshift(i[0][t[3]]=i[0][t[3]]||{}):t[4]||(i[0][t[1]]=t[2]);return i[0]})(e):e,i?"":o)),t,n),o.slice(1)},te=(e,t,i)=>e.reduce((e,n,s)=>{let o=t[s];if(o&&o.call){let e=o(i),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;o=t?"."+t:e&&e.props?"":e}return e+n+(null==o?"":o)},"");function ie(e){let t=this||{},i=e.call?e(t.p):e;return ee(i.map?te(i,[].slice.call(arguments,1),t.p):i,Q(t.target),t.g,t.o)}ie.bind({g:1});const ne=ie(["position:fixed;display:block;width:100%;height:0px;margin:0px;padding:0px;overflow:visible;transform-style:preserve-3d;background:transparent;backface-visibility:hidden;pointer-events:none;left:0px;z-index:9998;"]),se=ie(["top:0px;z-index:9999;height:100%;width:100%;"]),oe=ie(["bottom:0px;"]),re=ie(["position:fixed;z-index:9989;"]),ae=ie(["left:0;bottom:0;"]),ce=ie(["right:0;bottom:0;"]),le=ie(["left:0;top:0;"]),he=ie(["right:0;top:0;"]),de=ie(["position:relative;overflow:hidden;display:none;"]),ue=ie(["display:block;"]),me="hs-web-interactives-banner-style-element",ge="hs-web-interactives-top-banner-open",pe="hs-web-interactives-top-anchor",fe="hs-web-interactives-top-push-anchor",ve="hs-web-interactives-bottom-anchor",Ce="hs-web-interactives-floating-container",Te="hs-web-interactives-floating-top-left-anchor",be="hs-web-interactives-floating-top-right-anchor",ye="hs-web-interactives-floating-bottom-left-anchor",we="hs-web-interactives-floating-bottom-right-anchor",Ee=e=>`\n .${ge} .hs-is-fixed-element {\n translate: 0px ${e}px!important;\n }\n`,Se=()=>`\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n`;class Ae{constructor(){this.render();this.topPushAnchor=document.getElementById(fe);this.topAnchor=document.getElementById(pe);this.bottomAnchor=document.getElementById(ve);this.floatingAnchors={[v.TOP_LEFT]:document.getElementById(Te),[v.TOP_RIGHT]:document.getElementById(be),[v.BOTTOM_LEFT]:document.getElementById(ye),[v.BOTTOM_RIGHT]:document.getElementById(we)};this.bottomRightFloatingButtonAnchor=this.floatingAnchors.BOTTOM_RIGHT}attachInteractiveOverlayToAnchor(e){e.containerType!==o.MODAL?e.isFloatingButtonLike?this.attachFloatingButton(e):e.containerType!==o.BANNER&&e.containerType!==o.SLIDE_IN||this.attachBanner(e):this.attachModal(e)}attachModal(e){this.topAnchor.appendChild(e.container)}attachBanner(e){e.position===v.BOTTOM||e.position===v.BOTTOM_LEFT||e.position===v.BOTTOM_RIGHT?this.bottomAnchor.appendChild(e.container):e.position!==v.TOP&&e.position!==v.TOP_RIGHT&&e.position!==v.TOP_LEFT||this.topAnchor.appendChild(e.container)}attachFloatingButton(e){const t=this.floatingAnchors[e.position];t&&t.appendChild(e.container)}addMarginForConversations(e){this.bottomRightFloatingButtonAnchor.style.marginBottom=e+"px"}removeMarginForConversations(){this.bottomRightFloatingButtonAnchor.style.marginBottom=""}insertPushBanner(){const e=document.createElement("div");e.id=fe;e.classList.add(de);document.body.prepend(e)}showPushBanner(e){this.topPushAnchor.style.height=e+"px";this.topPushAnchor.classList.add(ue);document.body.classList.add(ge);const t=document.createElement("style");t.id=me;t.innerHTML=Ee(e);document.head.appendChild(t)}hidePushBanner(){this.topPushAnchor.style.height="";this.topPushAnchor.classList.remove(ue);document.body.classList.remove(ge);const e=document.getElementById(me);e&&document.head.removeChild(e)}render(){this.insertPushBanner();document.body.insertAdjacentHTML("beforeend",Se())}}const Ie=ie(["position:absolute;pointer-events:none;width:101vw;height:101vh;background:rgba(0,0,0,0.7);opacity:0;z-index:-1;"]),Me=ie(["z-index:99998;opacity:0.8;visibility:visible;pointer-events:all;cursor:pointer;"]),Oe=ie(["overflow:hidden;"]);class Pe{constructor({parent:e,handleClick:t=(()=>{})}){this.disableBodyScroll=!1;this.overlay=document.createElement("div");this.overlay.id="hs-interactives-modal-overlay";this.overlay.classList.add(Ie);this.handleClick=t;this.render(e);this.listenForClick()}listenForClick(){this.overlay.addEventListener("click",this.handleClick)}enableDisableBodyScroll(){this.disableBodyScroll=!0}show(){this.overlay.classList.add(Me);this.disableBodyScroll&&document.body.classList.add(Oe)}hide(){this.overlay.classList.remove(Me);document.body.classList.remove(Oe)}render(e){e.appendChild(this.overlay)}}const _e={modalPosition:null,bannerPositions:{TOP_LEFT:null,TOP_RIGHT:null,BOTTOM_LEFT:null,BOTTOM_RIGHT:null,BOTTOM:null,TOP:null},floatingPositions:{TOP_LEFT:null,TOP_RIGHT:null,BOTTOM_LEFT:null,BOTTOM_RIGHT:null}},Fe=[v.TOP,v.TOP_LEFT,v.TOP_RIGHT],Le=[v.BOTTOM,v.BOTTOM_LEFT,v.BOTTOM_RIGHT];class Re{constructor({isMobile:e=!1}){this.isMobile=!1;this.store=new n.Store(_e);this.isMobile=e}setPosistionFromConfig(e){const{contentModelId:t,containerType:i,containerStyles:{position:n}}=e,s=b.isFloatingButtonLike(e);i===o.MODAL?this.setModalPosition(t):i!==o.BANNER&&!o.SLIDE_IN||s?s&&this.setFloatingPosition(n,t):this.setBannerPosition(n,t)}get modalPosition(){return this.store.state.modalPosition}get bannerPositions(){return this.store.state.bannerPositions}get floatingPositions(){return this.store.state.floatingPositions}canBeInsertedIntoPosition(e){return this.isMobile?this.canBeInsertedIntoPositionMobile(e):this.canBeInsertedIntoPositionDesktop(e)}canBeInsertedIntoPositionMobile(e){const t=b.isFloatingButtonLike(e);return e.containerType===o.MODAL?!this.modalPosition:e.containerType===o.BANNER||e.containerType===o.SLIDE_IN&&!t?Object.keys(this.bannerPositions).reduce((e,t)=>e&&!this.bannerPositions[t],!0):!!t&&Object.keys(this.floatingPositions).reduce((e,t)=>e&&!this.floatingPositions[t],!0)}canBeInsertedIntoPositionDesktop(e){const t=b.isFloatingButtonLike(e);return e.containerType===o.MODAL?!this.modalPosition:e.containerType===o.BANNER||e.containerType===o.SLIDE_IN&&!t?Le.includes(e.containerStyles.position)?!this.bannerPositions[v.BOTTOM]&&!this.bannerPositions[v.BOTTOM_LEFT]&&!this.bannerPositions[v.BOTTOM_RIGHT]:!!Fe.includes(e.containerStyles.position)&&(!this.bannerPositions[v.TOP]&&!this.bannerPositions[v.TOP_LEFT]&&!this.bannerPositions[v.TOP_RIGHT]):!!t&&!this.floatingPositions[e.containerStyles.position]}setModalPosition(e){this.store.setState(t=>Object.assign({},t,{modalPosition:e}))}setBannerPosition(e,t){this.store.setState(i=>{const n=i.bannerPositions;return Object.assign({},i,{bannerPositions:Object.assign({},n,{[e]:t})})})}setFloatingPosition(e,t){this.store.setState(i=>{const n=i.floatingPositions;return Object.assign({},i,{floatingPositions:Object.assign({},n,{[e]:t})})})}}function Ne(e){return new Re({isMobile:e})}const ke=6e4,He=1440*ke,De=7*He,Be=4*De,xe={REPEAT_ONCE:"REPEAT_ONCE",REPEAT_FOREVER:"REPEAT_FOREVER",ONCE_OFF:"ONCE_OFF"},Ve={DAYS:"DAYS",MONTHS:"MONTHS",WEEKS:"WEEKS",MINUTES:"MINUTES"},je=Object.freeze({DAYS:He,MONTHS:Be,WEEKS:De,MINUTES:ke}),$e="WI_IGNORED",Ue="WI_FREQUENCY",Ge={frequency:xe.REPEAT_ONCE,backoff:{backoffTimeDuration:2,backoffTimeUnit:Ve.WEEKS}},qe=e=>{try{if(!localStorage.getItem(`${Ue}_${e}`)){const t=localStorage.getItem(`${$e}_${e}`);if(!t)return!1;return parseInt(t,10)>Date.now()-2*je.WEEKS}const t=JSON.parse(localStorage.getItem(`${Ue}_${e}`));switch(t.frequency){case xe.ONCE_OFF:return!0;case xe.REPEAT_FOREVER:return!1;case xe.REPEAT_ONCE:{const{timeSaved:e,backoffTimeDuration:i,backoffTimeUnit:n}=t,s=i*je[n];return e>Date.now()-s}default:return!1}}catch(e){return!1}},We=(e,t)=>{let i=t;i&&i.frequency||(i=Ge);const{frequency:n,backoff:s}=i;try{let t={frequency:n};s&&(t=Object.assign({},t,{},s,{timeSaved:Date.now()}));localStorage.setItem(`${Ue}_${e}`,JSON.stringify(t))}catch(e){return}},ze=(e,{frequency:t,backoff:i})=>{try{if(!t)return;const n=`${Ue}_${e}`,s=JSON.parse(localStorage.getItem(n));if(!s)return;if(s.frequency!==t){localStorage.removeItem(n);return}if(!i||!s.backoffTimeDuration)return;i.backoffTimeDuration===s.backoffTimeDuration&&i.backoffTimeUnit===s.backoffTimeUnit||localStorage.removeItem(n)}catch(e){return}},Ye=ie(["display:block !important;position:static !important;box-sizing:border-box !important;background:transparent !important;border:none;min-height:0px !important;max-height:none !important;margin:0px;padding:0px !important;height:100% !important;width:1px !important;max-width:100% !important;min-width:100% !important;"]);function Qe(e,t={}){Object(s.a)("Setting style on element",t,e);for(const i in t)Object.hasOwnProperty.call(t,i)&&(e.style[i]=t[i])}const Xe="hs-cta-embed__loaded",Ke=()=>{};class Je{constructor({src:e,contentId:t,containerStyle:i,configStyle:s,iframeStyle:o,containerType:r,isFloatingButtonLike:a,isTopBanner:c}){this.onClose=Ke;this.setDeferredPromise();this.container=document.createElement("div");this.contentId=t;this.container.id="hs-overlay-cta-"+t;this.frameComponent=Object(n.createFrameComponent)({container:this.container,id:t,iframeSrc:e,onFrameReady:this.resolveFrameload,resizeHeight:s.scaleHeightToFitContent||Boolean(s.isSingleModuleOnly),useResponsiveStyling:s.useResponsiveStyling,extraAttributes:{"aria-label":"Popup CTA",title:"Popup CTA"}});this.frameComponent.iframe.setAttribute("data-test-id","interactive-frame");this.frameComponent.iframe.classList.add(Ye);this.containerStyle=i;this.iframeStyle=o;this.configStyle=s;this.containerType=r;this.position=s.position||null;this.isFloatingButtonLike=a;this.isTopBanner=c;this.applyStyleElements();this.render()}applyStyleElements(){this.frameComponent.setStyle(this.iframeStyle);Qe(this.container,this.containerStyle)}setDeferredPromise(){this.frameLoadPromise=new Promise(e=>{this.resolveFrameload=e})}open(){return this.frameLoadPromise.then(()=>{this.frameComponent.setStyle({visibility:""});this.container.classList.add(Xe);this.internalOpen()}).catch(()=>{})}close(){}render(){}skipAnimation(){}setAnimationForClickTrigger(){}registerCloseHandler(e){this.frameComponent.iframeCommunicator.registerHandlers({[n.MessageTypes.CLOSE_INTERACTIVE]:e})}internalOpen(){}}const Ze=(...e)=>{Object(s.a)("[overlays/Modal]",...e)},et=ie(["z-index:99999;visibility:hidden;position:absolute;inset:50vh auto auto 50%;transform:translate(-50%,-50%);left:50%;top:50%;opacity:0;pointer-events:none;max-height:95%;max-width:95%;"]),tt=ie(["pointer-events:auto !important;visibility:visible;opacity:1;transition:opacity 1s ease-in;"]),it=ie(["transition:opacity 0.3s ease-in;"]);class nt extends Je{internalOpen(){this.container.classList.add(tt);this.focusElement()}focusElement(){try{this.frameComponent.iframe.focus()}catch(e){Ze("Frame not defined",e)}}setAnimationForClickTrigger(){this.container.classList.add(it)}close(){this.container.classList.remove(tt)}render(){this.frameComponent.iframe.setAttribute("role","dialog");this.container.classList.add(et)}}const st=ie(["pointer-events:auto !important;visibility:visible !important;max-height:95vh !important;transition:max-height 1s ease-in;"]),ot=ie(["z-index:9999;width:100%;max-height:0px;position:fixed;max-height:95%;visibility:hidden;"]),rt=ie(["z-index:9999;width:100%;max-height:0px;position:fixed;max-height:95%;visibility:hidden;bottom:0px;"]),at={[v.TOP]:ot,[v.BOTTOM]:rt};class ct extends Je{internalOpen(){this.container.classList.add(st)}close(){this.container.classList.remove(st)}addPositionClass(){const{position:e}=this.configStyle;this.container.classList.add(at[e])}render(){this.addPositionClass();this.container.classList.add(ot)}}const lt=ie(["visibility:hidden;"]),ht=ie(["visibility:visible !important;"]);class dt extends Je{internalOpen(){this.container.classList.add(ht)}close(){this.container.classList.remove(ht)}render(){this.container.classList.add(lt)}}const ut=ie(["pointer-events:auto !important;visibility:visible !important;max-height:95vh !important;transform:none !important;"]),mt=ie(["z-index:9999;width:100%;max-height:0px;position:fixed;max-height:95%;visibility:hidden;transition:transform 0.5s cubic-bezier(0.31,-0.2,0.04,1.47);"]),gt=ie(["z-index:9999;position:fixed;left:10px;top:10px;max-height:95vh !important;max-width:95%;visibility:hidden;"]),pt=ie(["z-index:9999;position:fixed;right:10px;top:10px;max-height:95vh !important;max-width:95%;visibility:hidden;"]),ft=ie(["z-index:9999;position:fixed;left:10px;bottom:10px;max-height:95vh !important;max-width:95%;visibility:hidden;"]),vt=ie(["z-index:9999;position:fixed;right:10px;bottom:10px;max-height:95vh !important;max-width:95%;visibility:hidden;"]),Ct=ie(["transition:none !important;"]),Tt={[v.BOTTOM_RIGHT]:vt,[v.BOTTOM_LEFT]:ft,[v.TOP_RIGHT]:pt,[v.TOP_LEFT]:gt};class bt extends Je{internalOpen(){this.container.classList.add(ut)}close(){this.container.classList.remove(ut)}skipAnimation(){this.container.classList.add(Ct)}addPositionClass(){const{position:e}=this.configStyle;this.container.classList.add(Tt[e])}addOffset(){const e=this.containerStyle.width;if(!e)return;switch(this.configStyle.position){case v.BOTTOM_LEFT:case v.TOP_LEFT:this.container.style.transform=`translateX(-${e})`;return;case v.BOTTOM_RIGHT:case v.TOP_RIGHT:this.container.style.transform=`translateX(calc(100% + ${e}))`;return}}render(){this.addPositionClass();this.addOffset();this.frameComponent.iframe.setAttribute("role","dialog");this.container.classList.add(mt)}}function yt(e,t){const i=b.isFloatingButtonLike(e),n=b.isTopBannerLike(e),s={src:t,configStyle:e.containerStyles,contentId:e.contentModelId,containerType:e.containerType,containerStyle:b.getStylesFromContainerStyles(e.containerStyles),iframeStyle:b.getStylesForIframe(e.containerStyles),isFloatingButtonLike:i,isTopBanner:n};if(i)return new dt(s);switch(e.containerType){case o.MODAL:return new nt(s);case o.BANNER:return new ct(s);case o.SLIDE_IN:return new bt(s);default:return null}}function wt(e){if("buttons"in(e=e||window.event))return e.buttons<2;return(e.which||e.button)<2}const Et=(...e)=>{Object(s.a)("[ClickTrigger",...e)},St=ie(["cursor:pointer;"]);class At{constructor(e,t){this.button=e;this.onClick=t;this.init();this.addA11yAttributes()}addA11yAttributes(){this.button.setAttribute("aria-haspopup","dialog")}init(){Et("Setting up click trigger");this.button.removeAttribute("href");this.button.removeAttribute("target");this.button.classList.add(St);this.button.removeAttribute("href");this.button.removeAttribute("target");this.button.addEventListener("mouseup",e=>{Et("Mouse up on click trigger",e);wt(e)&&this.onClick()});this.button.addEventListener("keypress",e=>{if("Enter"===e.key){Et("Enter on click trigger",e);this.onClick()}})}}var It=i(16);function Mt(e,t){const i=new ResizeObserver(i=>{for(const n of i)n.target===e&&n.contentRect&&t(n.contentRect.height,n.contentRect.height)});i.observe(e);return()=>i.disconnect()}const Ot="hubspot-messages-iframe-container",Pt=()=>{},_t=220,Ft=400,Lt="userInteractedWithWidget";class Rt{constructor(e){this.disconnectResizeObserver=Pt;this.conversationsFrameContainer=null;this.handleConversationsReady=()=>{this.addConversationsEventListeners();this.pollForConversationsRendered().then(()=>{this.conversationsFrameContainer=document.getElementById(Ot);this.addConversationsStyleSheet();this.listenForConversationsHeightChange();this.setFloatingButtonOffset()}).catch(()=>{})};this.overlayContainer=e;this.listenForConversationsReady()}listenForConversationsReady(){window.HubSpotConversations?this.handleConversationsReady():window.hsConversationsOnReady&&window.hsConversationsOnReady.length?window.hsConversationsOnReady=[...window.hsConversationsOnReady,this.handleConversationsReady]:window.hsConversationsOnReady=[this.handleConversationsReady]}listenForConversationsHeightChange(){if(!this.conversationsFrameContainer)return;const e=Mt(this.conversationsFrameContainer,e=>{this.conversationsFrameContainer&&e<_t&&this.setFloatingButtonOffset()});this.disconnectResizeObserver=e}addConversationsEventListeners(){window.HubSpotConversations&&window.HubSpotConversations.on(Lt,()=>{_()&&this.removeConversationsStyleSheet()})}pollForConversationsRendered(){return new Promise(e=>{const t=setInterval(()=>{if(document.getElementById(Ot)){e();clearInterval(t)}},Ft)})}setFloatingButtonOffset(){if(!this.overlayContainer||!this.conversationsFrameContainer)return;const e=this.conversationsFrameContainer.clientHeight;this.overlayContainer.addMarginForConversations(e)}addConversationsStyleSheet(){const e=document.createElement("style");e.id="web-interactives-conversations-override";e.innerHTML="#hubspot-messages-iframe-container { z-index: 9990!important; }";document.head.appendChild(e)}removeConversationsStyleSheet(){const e=document.getElementById("web-interactives-conversations-override");e&&e.remove()}}function Nt(e){return new Rt(e)}const kt=-1;class Ht{constructor({configModel:e,environmentModel:t,analyticsModel:i,scheduledCTAsModel:s,handleView:r,scheduleCTA:a}){this.triggerMap=new Map;this.shownModal=null;this.triggeredCTAFromCallback=null;this.clickTriggerComponentMap=new Map;this.interactiveComponentMap=new Map;this.conversationsController=null;this.listenForKeypress=()=>{Object(n.listenForEscPress)(()=>{this.shownModal&&this.closeOverlay(this.shownModal)})};this.sendAnalyticsToCTA=e=>{n.GlobalIframeCommunication.broadcast(e,{type:n.MessageTypes.RECEIVED_ANALYTICS,payload:this.analyticsModel.analytics})};this.handleTrigger=e=>{if(!qe(e)){this.openOverlay(e);for(const[t,i]of this.triggerMap)t===e&&i.forEach(e=>e.remove());this.triggerMap.delete(e)}};this.handleTriggerFromCTA=({triggerCTA:e,id:t})=>{this.interactiveComponentMap.has(t)&&(this.interactiveComponentMap.has(e)?this.shouldCloseCalloutCTA(t)&&this.closeOverlay(t):this.triggeredCTAFromCallback=[e,t]);this.interactiveComponentMap.has(e)?this.handleClickOpen(e):this.scheduledCTAsModel.scheduledCTAs.has(e)||this.scheduleCTA(e)};this.handleClickOpen=e=>{this.openOverlay(e,!0)};this.handleOverlayClick=()=>{if(!Number.isInteger(this.shownModal))return;const e=this.configModel.configs.get(this.shownModal);e&&e.containerStyles.closeOnOverlayClick&&this.closeOverlay(this.shownModal)};this.handlePageNavigation=({id:e,openNewTab:t,url:i})=>{t||Object(n.isSameUrlExceptAnchor)(window.location.href,i)||this.shouldCloseCalloutCTA(e)&&this.environmentModel.isUngatedFor("WebInteractives:CloseCTAOnNavigation")&&this.shouldCloseCalloutCTA(e)&&this.closeOverlay(e)};this.handleFormSubmission=({id:e})=>{const t=this.configModel.configs.get(e);t&&t.shouldCloseOnFormSubmission&&t.isDismissable&&this.closeOverlay(e)};this.closeOverlay=e=>{let t;t=this.configModel.templateConfig?this.interactiveComponentMap.get(kt):this.interactiveComponentMap.get(e);if(t){t.isTopBanner&&this.overlayedInteractivesContainer.hidePushBanner();t.containerType===o.MODAL&&this.overlay.hide();t.close();e===this.shownModal&&(this.shownModal=null);document.activeElement instanceof HTMLElement&&document.activeElement.blur();this.messageCTAClosed(e)}};this.configModel=e;this.environmentModel=t;this.analyticsModel=i;this.scheduledCTAsModel=s;this.overlayedInteractivesContainer=null;this.overlay=null;this.handleView=r;this.scheduleCTA=a;this.listenToConfigUpdates();this.listenForOpenCTAMessage();this.listenForKeypress();this.registerMessageHandlers();this.triggerOpen=this.handleClickOpen}init({clickTriggerButtons:e}){this.posistionsOccupied=Ne(this.environmentModel.isMobile);this.overlayedInteractivesContainer=new Ae;this.overlay=new Pe({parent:this.overlayedInteractivesContainer.topAnchor,handleClick:this.handleOverlayClick});this.conversationsController=Nt(this.overlayedInteractivesContainer);this.createClickTriggerComponents(e)}registerMessageHandlers(){n.GlobalIframeCommunication.registerHandlers({[n.MessageTypes.TRIGGER_CTA]:this.handleTriggerFromCTA,[n.MessageTypes.NAVIGATE_PAGE]:this.handlePageNavigation,[n.MessageTypes.CTA_FORM_SUBMITTED]:this.handleFormSubmission})}createClickTriggerComponents(e){for(const[t,i]of e)i.forEach(e=>{const i=new At(e,()=>this.handleClickOpen(t)),n=this.clickTriggerComponentMap.get(t)||[];this.clickTriggerComponentMap.set(t,[...n,i])})}createOverlayInteractivesWithAudience(){for(const[e,t]of this.configModel.sortedConfigsWithSpecificty){if(!this.shouldCreateInteractiveOverlay(t))continue;if(!this.createOverlayComponentAndSetOnMap(t))continue;this.posistionsOccupied.setPosistionFromConfig(t);const e=Object(It.createTrigger)(t.triggers,()=>this.handleTrigger(t.contentModelId));if(!e.length)return;this.environmentModel.isUngatedFor("WebInteractives:MainElementScrollTrigger")&&e.forEach(e=>{"boolean"==typeof e.ungatedForMainElementScroll&&(e.ungatedForMainElementScroll=!0)});this.triggerMap.set(t.contentModelId,e)}}createOverlayInteractivesWithNoAudience(){for(const[e,t]of this.configModel.overlayedConfigsWithNoAudience){if(this.interactiveComponentMap.has(e))continue;if(!this.createOverlayComponentAndSetOnMap(t))return;if(this.scheduledCTAsModel.scheduledCTAs.has(e)){this.openOverlay(e,!0);this.scheduledCTAsModel.removeCTA(e)}this.sendAnalyticsToCTA(e)}}createTemplateOverlayInteractive(){this.createOverlayComponentAndSetOnMap(this.configModel.templateConfig)}createPreviewOverlayInteractive(){this.createOverlayComponentAndSetOnMap(this.configModel.previewConfig)}createOverlayComponentAndSetOnMap(e){const t=yt(e,h(e.iframeSrc,this.environmentModel,this.analyticsModel));if(!t)return null;let i;i="contentModelId"in e?e.contentModelId:kt;if(this.triggeredCTAFromCallback){const[e]=this.triggeredCTAFromCallback;i===e&&t.skipAnimation()}this.interactiveComponentMap.set(i,t);this.overlayedInteractivesContainer.attachInteractiveOverlayToAnchor(t);t.registerCloseHandler(()=>this.closeOverlay(e.contentModelId));return t}shouldCreateInteractiveOverlay(e){return!(qe(e.contentModelId)&&!this.clickTriggerComponentMap.has(e.contentModelId))&&!!this.posistionsOccupied.canBeInsertedIntoPosition(e)}listenToConfigUpdates(){this.configModel.store.subscribe((e,t)=>{if(this.environmentModel.isPreview&&1===e.configs.size){this.createPreviewOverlayInteractive();requestAnimationFrame(()=>{this.configModel.previewConfig&&this.openOverlay(this.configModel.previewConfig.contentModelId)})}else if(0===t.configs.size&&e.configs.size>0)setTimeout(()=>{this.createOverlayInteractivesWithAudience();this.createOverlayInteractivesWithNoAudience();this.overlay&&this.overlay.enableDisableBodyScroll()});else if(e.templateConfig){this.createTemplateOverlayInteractive();requestAnimationFrame(()=>{this.openOverlay(kt)})}else{e.configs.size>t.configs.size&&this.createOverlayInteractivesWithNoAudience();if(this.triggeredCTAFromCallback){const[t,i]=this.triggeredCTAFromCallback;if(e.configs.has(t)){this.triggeredCTAFromCallback=null;this.shouldCloseCalloutCTA(i)&&this.closeOverlay(i)}}}})}listenForOpenCTAMessage(){window.addEventListener("message",e=>{e&&e.data&&e.data.type===n.MessageTypes.DISPLAY_CALL_TO_ACTION&&this.openOverlay(e.data.id)})}openOverlay(e,t=!1){const i=this.interactiveComponentMap.get(e);if(i){i.isTopBanner&&this.overlayedInteractivesContainer.showPushBanner(i.container.clientHeight);t&&i.setAnimationForClickTrigger();i.open().then(()=>{i.isTopBanner&&this.overlayedInteractivesContainer.showPushBanner(i.container.clientHeight);if(i.containerType===o.MODAL){this.shownModal=e;this.overlay.show()}this.handleView(e);n.GlobalIframeCommunication.broadcast(e,{type:n.MessageTypes.SHOWING_CTA,payload:{}})}).catch(()=>{})}}messageCTAClosed(e){n.GlobalIframeCommunication.broadcast(e,{type:n.MessageTypes.HAS_CLOSED,payload:{}})}shouldCloseCalloutCTA(e){const t=this.configModel.configs.get(e);return!!t&&t.isDismissable}}const Dt="hs-cta-embed__loaded";class Bt{constructor({contentId:e,embedContainer:t,iframeSrc:i,useResponsiveStyling:s}){this.listenForLoad();this.frameComponent=Object(n.createFrameComponent)({id:e,container:t,iframeSrc:i,resizeHeight:!0,onFrameReady:this.resolveFrameload,useResponsiveStyling:s,extraAttributes:{"aria-label":"Embedded CTA",title:"Embedded CTA"}});this.frameComponent.iframe.setAttribute("data-test-id","interactive-frame");this.frameComponent.iframe.classList.add(Ye);this.contentId=e;this.embedContainer=t}setStyles(e,t,i){this.frameComponent.setShouldResize(i);Object(n.setStyleOnElement)(this.embedContainer,e);this.frameComponent.setStyle(Object.assign({},t));this.resolveConfig&&this.resolveConfig()}showFrame(){this.frameComponent.setStyle({visibility:""})}listenForLoad(){const e=new Promise(e=>{this.resolveFrameload=e}),t=new Promise(e=>{this.resolveConfig=e});Promise.all([e,t]).then(()=>{Array.from(this.embedContainer.children).forEach(e=>{e!==this.frameComponent.iframe&&this.embedContainer.removeChild(e)});this.embedContainer.classList.add(Dt);this.showFrame()}).catch(()=>{})}}class xt{constructor({environmentModel:e,configStore:t,handleView:i,analyticsModel:s,scheduledCTAsModel:o}){this.embeddedInteractives=new Map;this.elementObserver=Object(n.createElementObserver)();this.styledComponentSet=new Set;this.flushScheduledCTAs=()=>{for(const e of this.scheduledCTAsModel.scheduledCTAs){const t=this.configStore.embeddedConfigs.get(e);if(!t||t.isHTMLVersionOnly)continue;if(!this.scheduledCTAsModel.elementsForEmbeddedCTAs.has(e))continue;this.scheduledCTAsModel.elementsForEmbeddedCTAs.get(e).forEach(t=>{this.createView(e,t)});this.handleView(e);this.scheduledCTAsModel.removeCTA(e)}};this.environmentModel=e;this.configStore=t;this.scheduledCTAsModel=o;this.handleView=i;this.analyticsModel=s}init({embedContainers:e}){this.embedContainers=e;this.environmentModel.isPreview||this.environmentModel.isTemplate||this.createViews();this.listenForConfigs();this.listenForElementViews();this.listenForScheduledCTAs()}listenForScheduledCTAs(){this.scheduledCTAsModel.subscribe(this.flushScheduledCTAs)}listenForElementViews(){if(this.embedContainers)for(const[e,t]of this.embedContainers)for(const i of t)this.elementObserver.observe(i,()=>this.handleView(e))}listenForConfigs(){this.configStore.configs.size>0?this.setStylesOnContainer():this.configStore.subscribe(()=>{this.scheduledCTAsModel.scheduledCTAs.size>0&&this.flushScheduledCTAs();if(this.configStore.embeddedConfigs.size>0){(this.environmentModel.isPreview||this.environmentModel.isTemplate)&&this.configStore.embeddedConfigs.size>0&&this.createViews();this.setStylesOnContainer()}})}setStylesOnContainer(){for(const[e,t]of this.configStore.embeddedConfigs){const i=this.embeddedInteractives.get(e);i&&i.length&&i.forEach(e=>{if(!this.styledComponentSet.has(e)){this.styledComponentSet.add(e);e.setStyles(b.getStylesFromContainerStyles(t.containerStyles),b.getStylesForIframe(t.containerStyles),t.containerStyles.scaleHeightToFitContent||Boolean(t.containerStyles.isSingleModuleOnly))}})}}createViews(){for(const[e,t]of this.embedContainers){let i="";const n=this.configStore.embeddedConfigs.get(e);i=n?n.iframeSrc:l({contentId:e,portalId:this.environmentModel.portalId,env:this.environmentModel.env,hublet:this.environmentModel.hublet});i=h(i,this.environmentModel,this.analyticsModel);const s=[];t.forEach(t=>{const o=new Bt({contentId:e,embedContainer:t,iframeSrc:i,useResponsiveStyling:!!n&&n.containerStyles.useResponsiveStyling});s.push(o)});this.embeddedInteractives.set(e,s)}}createView(e,t){const i=this.configStore.embeddedConfigs.get(e);if(!i)return;const n=h(i.iframeSrc,this.environmentModel,this.analyticsModel),s=new Bt({contentId:e,embedContainer:t,iframeSrc:n,useResponsiveStyling:i.containerStyles.useResponsiveStyling}),o=this.embeddedInteractives.get(e)||[];this.embeddedInteractives.set(e,[...o,s]);this.setStylesOnContainer()}}const Vt="POP_OVER",jt="hsCta";class $t{constructor({configStore:e,environmentModel:t}){this.ignoreCta=({id:e})=>{if(this.environmentModel.isPreview)return;const t=this.configStore.configs.get(e);t&&t.containerType!==o.EMBEDDED&&We(e,t.displayFrequency)};this.registerPopupPolice=({id:e})=>{const t=this.configStore.configs.get(e);t&&t.containerType===o.MODAL&&window._registerAvailablePopup&&window._registerAvailablePopup(jt,Vt)};this.configStore=e;this.environmentModel=t;this.registerHandlers();this.listenForConfigs()}registerHandlers(){n.GlobalIframeCommunication.registerHandlers({[n.MessageTypes.NAVIGATE_PAGE]:this.ignoreCta,[n.MessageTypes.CLOSE_INTERACTIVE]:this.ignoreCta,[n.MessageTypes.STARTED]:this.registerPopupPolice})}listenForConfigs(){this.configStore.subscribe((e,t)=>{if(e.configs.size!==t.configs.size)for(const[t,i]of e.configs)i.displayFrequency&&ze(t,i.displayFrequency)})}}function Ut(e){return new $t(e)}const Gt=ie(["display:flex;justify-content:center;align-items:center;"]),qt="interactive-ready";class Wt{constructor({environmentModel:e}){this.environmentModel=e}init(){if(this.environmentModel.isPreview||this.environmentModel.isScreenshot||this.environmentModel.templatePath){this.bodyWrapper=document.getElementsByClassName(B)[0];if(this.bodyWrapper){this.setupEmbedContainer();this.setHeightForPreview();this.listenForInteractiveLoaded()}}}setupEmbedContainer(){this.bodyWrapper.classList.add(Gt);const e=this.environmentModel.previewId||1;this.bodyWrapper.innerHTML=`\n
\n `}setHeightForPreview(){this.bodyWrapper.style.height="100vh"}listenForInteractiveLoaded(){n.GlobalIframeCommunication.registerHandlers({[n.MessageTypes.STARTED]:()=>document.body.classList.add(qt)})}}function zt({environmentModel:e}){return new Wt({environmentModel:e})}const Yt=e=>{let t=1,i=0;for(;t>0&&i!==e.length;){const n=e[i];"{"===n?t++:"}"===n&&t--;i++;if(i>e.length)return e.length}return i},Qt=e=>window.matchMedia(e).matches,Xt=e=>e.includes("width")?"@media (min-width: 0px)":e,Kt=(e,t=Qt)=>{let i="",n=e,s=n.indexOf("@media");if(-1===s)return!1;for(;s>0;){i=`${i}${n.substring(0,s-1)}`;n=n.substring(s);const e=n.indexOf("{"),o=n.substring(0,e);n=n.substring(e+1);const r=Yt(n);if(t(o.replace("@media ",""))){const e=n.substring(0,r-1);i=`${i}${Xt(o)} { ${e} }`}n=n.substring(r+1);s=n.indexOf("@media")}return`${i}${n}`.trim()},Jt=e=>Object.keys(e).reduce((t,i)=>{const n=Kt(e[i]);return n?Object.assign({},t,{[i]:n}):t},{});var Zt=(e,t)=>{let i=0;return(...n)=>{i&&clearTimeout(i);i=setTimeout(()=>{e(...n);i=0},t)}};const ei=(...e)=>{Object(s.a)("[ResponsiveController]",...e)};class ti{constructor(){this.initialStylesheets={}}init(){this.listenForStylesheetsHtml();const e=Zt(()=>Object.keys(this.initialStylesheets).forEach(e=>this.handleProcessStylesheets(Number(e))),100);window.addEventListener("resize",()=>{ei("Resizing, reprocessing stylesheets");e()})}listenForStylesheetsHtml(){n.GlobalIframeCommunication.registerHandlers({[n.MessageTypes.SEND_STYLESHEETS]:e=>{this.initialStylesheets[e.id]=e.stylesheetsHtml;this.handleProcessStylesheets(e.id)}})}handleProcessStylesheets(e){if(!this.initialStylesheets[e])return;const t=Jt(this.initialStylesheets[e]);n.GlobalIframeCommunication.broadcast(e||1,{type:n.MessageTypes.RECEIVE_FILTERED_STYLESHEETS,payload:{stylesheets:t}})}}function ii(){return new ti}function ni(e,t){return"https://perf{region}.hsforms{env}.com/embed/v3/counters.gif".replace("{region}","-"+e).replace("{env}","qa"===t?"qa":"")}const si={CONFIG_LOADED_SUCCESS:"config-loaded-success",CONFIG_LOADED_FAILURE:"config-loaded-failure",INTERACTIVE_SHOWN:"interactive-shown",INTERACTIVE_CLOSED:"interactive-closed",INTERACTIVE_NAVIGATED:"interactive-navigated",INLINE_INTERACTIVE_RENDER_SUCCESS:"inline-interactive-render-success",INLINE_INTERACTIVE_RENDER_FAIL:"inline-interactive-render-fail"};class oi{constructor({environmentModel:e,configStore:t}){this.perfUrl="";this.environmentModel=e;this.configStore=t;this.registerHandlers();this.listenToConfigStore()}init(){this.perfUrl=ni(this.environmentModel.hublet,this.environmentModel.env)}trackRender(e){this.trackMetric(e?si.INLINE_INTERACTIVE_RENDER_SUCCESS:si.INLINE_INTERACTIVE_RENDER_FAIL)}registerHandlers(){n.GlobalIframeCommunication.registerHandlers({[n.MessageTypes.STARTED]:()=>this.trackMetric(si.INTERACTIVE_SHOWN),[n.MessageTypes.CLOSE_INTERACTIVE]:()=>this.trackMetric(si.INTERACTIVE_CLOSED),[n.MessageTypes.NAVIGATE_PAGE]:()=>this.trackMetric(si.INTERACTIVE_NAVIGATED)})}listenToConfigStore(){this.configStore.subscribe(e=>{e.requestError?this.trackMetric(si.CONFIG_LOADED_FAILURE):e.isLoaded&&this.trackMetric(si.CONFIG_LOADED_SUCCESS)})}trackMetric(e){if(!this.perfUrl.length)return;const t=`${this.perfUrl}?key=${e}&value=1`;(new Image).src=t}}function ri(e){return new oi(e)}const ai=(...e)=>{Object(s.a)("[CTAAnalyticsController]",...e)};function ci({env:e,hublet:t}){const i="prod"===e?"":e;let n="";n="na1"!==t&&t?`https://cta-${t}.hubspot${i}.com/web-interactives/public/v1/track`:`https://cta-service-cms2.hubspot${i}.com/web-interactives/public/v1/track`;return n}class li{constructor({analyticsStore:e,configsStore:t,environmentModel:i,ctaViewedStore:s}){this.timingMap=new Map;this.viewQueue=Object(n.createQueue)();this.hasViewed=new Set;this.baseUrl="";this.trackView=({id:e})=>{if(this.configStore.isLoaded){this.trackWithImage(e,"view");this.timingMap.set(e,Date.now())}else this.viewQueue.enqueue(e)};this.trackClose=({id:e})=>{this.trackWithImage(e,"close")};this.trackTriggerClick=({id:e})=>{this.trackNavigation({id:e},!0)};this.trackNavigation=({id:e},t=!1)=>{const i=this.configStore.configs.get(e);if(!i)return;const n=new URL(this.attachTrackingParamsToUrl(this.baseUrl+"/click",e));t&&n.searchParams.set("beaconTrack","true");this.environmentModel.isUngatedFor("WebInteractives:JSTracking")&&i.shouldUseJsTracking&&n.searchParams.set("beaconTrack","true");n.searchParams.has("beaconTrack")&&("sendBeacon"in navigator?navigator.sendBeacon(n):fetch(n,{method:"POST",keepalive:!0}))};this.analyticsStore=e;this.configStore=t;this.environmentModel=i;this.ctaViewedStore=s}init(){this.baseUrl=ci({env:this.environmentModel.env,hublet:this.environmentModel.hublet});if(!this.environmentModel.isPreview&&!this.environmentModel.isTemplate){this.registerHandlers();this.listenForStoreLoad();this.listenForViewChange();this.handleViews()}}registerHandlers(){n.GlobalIframeCommunication.registerHandlers({[n.MessageTypes.CLOSE_INTERACTIVE]:this.trackClose,[n.MessageTypes.NAVIGATE_PAGE]:this.trackNavigation,[n.MessageTypes.TRIGGER_CTA]:this.trackTriggerClick})}listenForStoreLoad(){this.configStore.subscribe((e,t)=>{e.isLoaded&&!t.isLoaded&&this.flushViewQueue()})}listenForViewChange(){this.ctaViewedStore.subscribe(()=>{this.handleViews()})}handleViews(){for(const e of this.ctaViewedStore.viewed)if(!this.hasViewed.has(e)){this.trackView({id:e});this.hasViewed.add(e)}}flushViewQueue(){do{const e=this.viewQueue.dequeue();e&&this.trackView({id:e})}while(this.viewQueue.peek())}trackWithImage(e,t){ai("Tracking:",t,e);let i=`${this.baseUrl}/${t}`;i=this.attachTrackingParamsToUrl(i,e);(new Image).src=i}logTooLargeAnalytics(){ai("Logging url that will be truncated");const e=this.analyticsStore.analytics;if(!e)return;const t=JSON.stringify(Object.assign({},e,{portalId:this.environmentModel.portalId}));fetch(this.baseUrl+"/log",{method:"POST",headers:{"Content-Type":"application/json"},body:t})}attachTrackingParamsToUrl(e,t){const i=new URL(e),n=this.configStore.configs.get(t);if(!n)return i.href;i.searchParams.set("webInteractiveId",String(n.webInteractiveId));i.searchParams.set("containerType",n.containerType);i.searchParams.set("portalId",String(this.environmentModel.portalId));i.searchParams.set("audienceId",String(n.audienceId));n.campaignGuid&&i.searchParams.set("campaignId",n.campaignGuid);const s=this.analyticsStore.analytics;s&&Object.entries(s).forEach(([e,t])=>{t&&i.searchParams.set(e,String(t))});const o=this.timingMap.get(t);if(o){i.searchParams.set("timeStarted",String(o));i.searchParams.set("timeFinished",String(Date.now()))}i.href.length;return i.href}}function hi(e){return new li(e)}class di{constructor({configModel:e,customerCtaOptions:t,scheduleCTA:i}){this.defferedPromiseMap=new Map;this.handleCtaLoad=({id:e})=>{if(!this.defferedPromiseMap.has(e))return;this.defferedPromiseMap.get(e)(null);this.defferedPromiseMap.delete(e)};this.handleNavigate=({id:e})=>{const t=this.customerCtaOptions.options.get(e);t&&"function"==typeof t.onNavigate&&t.onNavigate()};this.loadCta=e=>new Promise((t,i)=>{e||i(new Error("Invalid options"));const{contentId:n,options:s}=e,{elementToEmbed:o}=s,r=d(s,["elementToEmbed"]);n||i(new Error("Invalid options"));this.scheduleCTA(n,Array.isArray(o)?o:[o]);Object.keys(r).length&&this.customerCtaOptions.setOption(n,r);this.defferedPromiseMap.set(n,t)});this.configModel=e;this.customerCtaOptions=t;this.scheduleCTA=i;window.hsCtasOnReady=window.hsCtasOnReady||[];this.attachToWindow();this.registerHandlers()}init(){this.flushOnReadyQueue()}registerHandlers(){n.GlobalIframeCommunication.registerHandlers({[n.MessageTypes.STARTED]:this.handleCtaLoad,[n.MessageTypes.NAVIGATE_PAGE]:this.handleNavigate})}attachToWindow(){window.__PRIVATE__HubspotCtaClient={loadCta:this.loadCta}}flushOnReadyQueue(){const e=window.hsCtasOnReady;for(;e.length;){const t=e.shift();"function"==typeof t&&t()}Object.defineProperty(window.hsCtasOnReady,"push",{value:e=>{"function"==typeof e&&e()},writable:!0})}}function ui(e){return new di(e)}const mi=(...e)=>{Object(s.a)("[NonFramedCTA]",...e)};class gi{constructor({cta:e,onNavigate:t,onView:i}){this.removeEventListenerCallbacks=[];this.elementObserver=Object(n.createElementObserver)();this.hasView=!1;this.id="";this.cta=e;this.id=this.cta.id;this.onNavigate=t;this.onView=i;this.listenForAnchorClicks();this.listenForView()}getCtaInstance(){this.cta&&this.cta.parentNode||(this.cta=document.getElementById(this.id));return this.cta}replaceCtaInstance(e){mi("Replacing html",e,this.id);const t=this.getCtaInstance();if(!t)return;const i=z(t,e);this.removeExistingEventListeners();t.innerHTML=i.innerHTML;t.dataset.rendered="true";this.reapplyEventListeners(t)}removeExistingEventListeners(){this.hasView||this.elementObserver.unobserve(this.cta);this.removeEventListenerCallbacks.forEach(e=>e());this.removeEventListenerCallbacks=[]}reapplyEventListeners(e){this.id=e.id;this.cta=e;this.listenForAnchorClicks();this.hasView||this.listenForView()}listenForAnchorClicks(){const e=[...this.cta.querySelectorAll("a")];"A"===this.cta.tagName&&e.push(this.cta);for(const t of e){const e="_blank"===t.target,i=e=>{e.preventDefault()};let n;t.classList.contains("hs-cta-trigger-button")&&(n=U(t));const s=i=>{i.preventDefault();wt(i)&&this.onNavigate(t.href,e,n)},o=i=>{if("Enter"===i.key){i.preventDefault();this.onNavigate(t.href,e,n)}};t.addEventListener("click",i);t.addEventListener("mouseup",s);t.addEventListener("keypress",o);this.removeEventListenerCallbacks.push(()=>{t.removeEventListener("click",i);t.removeEventListener("mouseup",s);t.removeEventListener("keypress",o)})}}listenForView(){this.elementObserver.observe(this.cta,()=>{this.onView();this.hasView=!0;this.elementObserver.unobserve(this.cta)})}}function pi(e){return new gi(e)}const fi=(...e)=>{Object(s.a)("[populateLinksWithTrackingParams]",...e)},vi=["currentUrl","referrer","canon","canonicalUrl","pageUrl","contentType","encryptedPayload","pageId","analyticsPageId","hutk","hstc","hssc","hsfp","utk","containerType","webInteractiveId","webInteractiveContentId","audienceId","campaignGuid","userAgent","timeStarted","timeFinished","redirectUrl","skip","includeInitial","pageTitle","contentGroupId","portalId"],Ci=`https://${(new Date).getTime()}-dummy.com`,Ti=(e,t)=>{let i,n=!1;try{i=new URL(e)}catch(t){fi("[populateLinksWithTrackingParams]","Checking for relative URL",e);n=!0}if(n)try{i=new URL(`${Ci}${e.startsWith("/"),""}${e}`)}catch(t){fi("Could not parse url for link",t);return e}Object.entries(t).forEach(([e,t])=>{vi.includes(e)?null!=t&&i.searchParams.set(e,String(t)):fi("Invalid analytics parameter passed",e)});const s=i.href;return n?s.replace(Ci,""):s};var bi=(e,t=[...document.querySelectorAll(".hs-web-interactive a")])=>{t.length&&t.forEach(t=>{const i=t.getAttribute("href");i&&!i.startsWith("javascript")&&t.setAttribute("href",Ti(i,e))})};const yi="render/html";function wi(e){let{isHubspotPage:t}=e,i=d(e,["isHubspotPage"]);const n={};t&&(n.isHubspotPage="true");return m(Object.assign({},i,{extraParams:n,path:yi}))}class Ei{constructor(){this.handleFetchFailed=()=>{this.store.setState(e=>Object.assign({},e,{requestError:!0}))};this.handleFetchSucceded=e=>{this.store.setState(t=>Object.assign({},t,{renderedHtmlMap:Object.assign({},t.renderedHtmlMap,{htmlMap:e}),isLoaded:!0}))};const e={renderedHtmlMap:{},request:null,requestError:!1,isLoaded:!1};this.store=new n.Store(e)}init(e){this.store.setState(t=>Object.assign({},t,{request:e}));return this.fetchEmbeddedHtml()}subscribe(e){this.store.subscribe(e)}get renderedHtmlMap(){return this.store.state.renderedHtmlMap}get isLoaded(){return this.store.state.isLoaded}fetch(e){return fetch(e).then(e=>{if(!e.ok){this.handleFetchFailed();return Promise.resolve(null)}return e.json().then(e=>{this.handleFetchSucceded(e);return e}).catch(this.handleFetchFailed)}).catch(this.handleFetchFailed)}fetchEmbeddedHtml(){const e=this.store.state.request;if(!e)return Promise.resolve(null);const t=wi(e);return this.fetch(t)}}var Si=new Ei;const Ai=(...e)=>{Object(s.a)("[NonFramedCTAController",...e)};class Ii{constructor({handleView:e,configStore:t,handleNavigation:i,analyticsStore:n,environmentModel:s,metricsController:o,scheduledCTAsModel:r,triggerOpen:a}){this.componentMap=new Map;this.cleanupFuncs=[];this.flushScheduledCTAs=()=>{for(const e of this.scheduledCTAsModel.scheduledCTAs){const t=this.configStore.embeddedConfigs.get(e);if(!t||!t.isHTMLVersionOnly)return;if(!this.scheduledCTAsModel.elementsForEmbeddedCTAs.has(e))return;const i=this.scheduledCTAsModel.elementsForEmbeddedCTAs.get(e);let n=this.nonFramedCTAContainers.get(e);n||(n=[]);this.nonFramedCTAContainers.set(e,[...n,...i]);this.createViewsForElements(e,i);this.requestHTML();this.scheduledCTAsModel.removeCTA(e)}};this.getAnchorsFromElements=e=>{let t=[];e.forEach(e=>{"A"===e.tagName&&(t=[...t,e]);t=[...t,...e.querySelectorAll("a")]});return t};this.handleView=e;this.handleNavigation=i;this.configStore=t;this.analyticsStore=n;this.environmentModel=s;this.renderedHtmlStore=Si;this.metricsController=o;this.scheduledCTAsModel=r;this.triggerOpen=a}init({nonFramedCTAContainers:e}){this.nonFramedCTAContainers=e;e.size&&this.requestHTML();this.listenForConfigs();this.listenForScheduledCTAs();this.environmentModel.isPreview||this.environmentModel.isPreviewPage||this.listenForAnalyticsUpdate()}listenForScheduledCTAs(){this.scheduledCTAsModel.subscribe(this.flushScheduledCTAs)}cleanup(){this.cleanupFuncs.forEach(e=>e())}requestHTML(){const e=e=>{if(e){this.metricsController.trackRender(!0);Object.keys(e).forEach(t=>{const i=Number(t),n=e[i],s=this.componentMap.get(i);if(s)s.forEach(e=>{e.replaceCtaInstance(n)});else{Ai("Views not created yet, just replacing existing elements");const e=this.nonFramedCTAContainers.get(i);e&&e.length&&e.forEach(e=>{const t=z(e,n);e.innerHTML=t.innerHTML;e.dataset.rendered="true"})}this.hydrateLinksWithAllData(i)})}},{isPreview:t,currentUrl:i,portalId:n,env:s,hublet:o,versionId:r}=this.environmentModel,a=[...this.nonFramedCTAContainers.keys()].filter(e=>!this.renderedHtmlStore.renderedHtmlMap[e]);if(!a.length)return;const c={contentIds:a,currentUrl:i,portalId:n,env:s,hublet:o,analytics:this.analyticsStore.analytics,isPreview:t,versionId:r,isHubspotPage:this.environmentModel.isCos()};Ai("Requesting HTML",c);this.renderedHtmlStore.init(c).then(e).catch(e=>{Ai("Failed getting HTML",e);this.metricsController.trackRender(!1)})}createViewsForElements(e,t){const i=[];let n=0;for(const s of t){s.id=`hs-cta-${e}-${n++}`;const o=pi({cta:s,onNavigate:(t,i,n)=>{n?this.triggerOpen&&this.triggerOpen(n):this.handleNavigation(t,e,i)},onView:()=>{this.handleView(e)}});i.push(o);const r=this.configStore.configs.get(e);if(r){const e=this.getAnchorsFromElements(t);bi({webInteractiveId:r.webInteractiveId,audienceId:r.audienceId,containerType:r.containerType,campaignId:r.campaignGuid,pageUrl:this.environmentModel.currentUrl,portalId:this.environmentModel.portalId},e)}}const s=this.componentMap.get(e)||[];this.componentMap.set(e,[...s,...i])}createViews(){for(const[e,t]of this.nonFramedCTAContainers)this.createViewsForElements(e,t)}hydrateLinksWithAllData(e){let t={};const i=this.configStore.configs.get(e);i&&(t={webInteractiveId:i.webInteractiveId,audienceId:i.audienceId,containerType:i.containerType,campaignId:i.campaignGuid,pageUrl:this.environmentModel.currentUrl,portalId:this.environmentModel.portalId});const n=this.analyticsStore.analytics;t=Object.assign({},t,{},n);let s=[];for(const[,e]of this.nonFramedCTAContainers)s=[...s,...this.getAnchorsFromElements(e)];bi(t,s)}listenForConfigs(){this.cleanupFuncs.push(this.configStore.subscribe(()=>{this.scheduledCTAsModel.scheduledCTAs.size>0&&this.flushScheduledCTAs();this.createViews()}))}listenForAnalyticsUpdate(){const e=()=>{let e=[];for(const[,t]of this.nonFramedCTAContainers)e=[...e,...this.getAnchorsFromElements(t)];bi(this.analyticsStore.analytics,e)};this.analyticsStore.analytics.isLoaded?e():this.cleanupFuncs.push(this.analyticsStore.subscribe((t,i)=>{!i.isLoaded&&t.isLoaded&&e()}))}}function Mi(e){return new Ii(e)}class Oi{constructor(){const e={options:new Map};this.store=new n.Store(e)}subscribe(e){this.store.subscribe(e)}setOption(e,t){const{openInNewTab:i,onNavigate:n}=t;d(t,["openInNewTab","onNavigate"]);this.store.setState(t=>{const s=structuredClone(t.options);s.set(e,{openInNewTab:i,onNavigate:n});return Object.assign({},t,{options:s})})}get options(){return this.store.state.options}}function Pi(){return new Oi}class _i{constructor(){const e={scheduledCTAs:new Set,elementsForEmbeddedCTAs:new Map};this.store=new n.Store(e)}subscribe(e){this.store.subscribe(e)}scheduleCTA(e){this.store.setState(t=>Object.assign({},t,{scheduledCTAs:new Set([...t.scheduledCTAs,e])}))}scheduleEmbeddedCTA(e,t){this.store.setState(i=>Object.assign({},i,{scheduledCTAs:new Set([...i.scheduledCTAs,e]),elementsForEmbeddedCTAs:Object(n.mergeMaps)(i.elementsForEmbeddedCTAs,new Map([[e,t]]))}))}removeCTA(e){this.store.setState(t=>{const i=structuredClone(t.scheduledCTAs);i.delete(e);return Object.assign({},t,{scheduledCTAs:i,elementsForEmbeddedCTAs:Object(n.filterMap)(t.elementsForEmbeddedCTAs,(t,i)=>i!==e)})})}get scheduledCTAs(){return this.store.state.scheduledCTAs}get elementsForEmbeddedCTAs(){return this.store.state.elementsForEmbeddedCTAs}}function Fi(){return new _i}const Li=(...e)=>{Object(s.a)("[ThirdPartyApiController",...e)},Ri={onCallToActionReady:"onCallToActionReady",onCallToActionViewed:"onCallToActionViewed",onCallToActionNavigated:"onCallToActionNavigated",onCallToActionFormSubmitted:"onCallToActionFormSubmitted"},Ni="hsCallsToActionCallback",ki=1e3;class Hi{constructor({configModel:e}){this.eventEmitter=Object(n.createEventEmitter)();this.refresh=Object(n.throttle)(()=>{Li("Called Refresh",this)},ki);this.configModel=e;window.hsCallsToActionsReady=window.hsCallsToActionsReady||[];this.registerHandlers()}init(){this.attachToWindow();this.flushOnReadyQueue()}handleView(e){this.handleEventCall({id:e},Ri.onCallToActionViewed)}attachToWindow(){window.HubSpotCallsToActions={on:this.eventEmitter.on.bind(this.eventEmitter),off:this.eventEmitter.off.bind(this.eventEmitter),refresh:this.refresh}}flushOnReadyQueue(){const e=window.hsCallsToActionsReady;for(;e.length;){const t=e.shift();"function"==typeof t&&t()}Object.defineProperty(window.hsCallsToActionsReady,"push",{value:e=>{"function"==typeof e&&e()},writable:!0})}handleEventCall(e,t){this.eventEmitter.emit(t,e);window.postMessage({type:Ni,id:e.id,eventName:t,data:e})}registerHandlers(){n.GlobalIframeCommunication.registerHandlers({[n.MessageTypes.STARTED]:e=>this.handleEventCall(e,Ri.onCallToActionReady),[n.MessageTypes.NAVIGATE_PAGE]:e=>this.handleEventCall(e,Ri.onCallToActionNavigated),[n.MessageTypes.CTA_FORM_SUBMITTED]:e=>this.handleEventCall(e,Ri.onCallToActionFormSubmitted)})}}function Di(e){return new Hi(e)}class Bi{constructor(e){this.environmentModel=e.environmentModel;this.configStore=e.configsStore}init(){window.addEventListener("pageshow",e=>{e.persisted&&this.shouldReloadPage()&&window.location.reload()})}shouldReloadPage(){return this.environmentModel.isUngatedFor("WebInteractives:BFCacheReload")&&this.configStore.configs.size>0}}function xi(e){return new Bi(e)}const Vi=(...e)=>{Object(s.a)("[WebInteractiveApplicationContainer]",...e)};function ji(e){const[t,i]=e.split("?");if(!i)return{location:t,queryParams:{}};return i.split("&").reduce((e,t)=>{const[i,n]=t.split("=");return Object.assign({[i]:n},e)},{})}class $i extends n.ParentApplicationController{constructor({configStore:e,environmentModel:t}){super();this.scheduleCTA=(e,t)=>{t?this.scheduledCTAs.scheduleEmbeddedCTA(e,t):this.scheduledCTAs.scheduleCTA(e);this.configStore.fetchConfigsWithIds([e])};this.handleView=e=>{this.viewedStore.markAsViewed(e);this.analyticsProxyController.flushViewQueue(e);this.thirdPartyApiController.handleView(e)};this.handleNavigation=(e,t,i=!1)=>{const s=this.getNavigationUrl({url:e,openNewTab:i},t);Object(n.navigatePage)(s,i)};this.configStore=e;this.environmentModel=t;this.viewedStore=k();this.customerCTAOptions=Pi();this.scheduledCTAs=Fi();this.overlayedInteractivesController=new Ht({configModel:this.configStore,environmentModel:t,analyticsModel:this.analyticsStore,scheduledCTAsModel:this.scheduledCTAs,handleView:this.handleView,scheduleCTA:this.scheduleCTA});this.embeddedInteractivesController=new xt({environmentModel:t,configStore:e,scheduledCTAsModel:this.scheduledCTAs,analyticsModel:this.analyticsStore,handleView:this.handleView});this.ignorerController=Ut({configStore:e,environmentModel:t});this.previewController=zt({environmentModel:this.environmentModel});this.responsiveController=ii();this.metricsController=ri({environmentModel:this.environmentModel,configStore:e});this.ctaAnalyticsController=hi({configsStore:this.configStore,analyticsStore:this.analyticsStore,environmentModel:this.environmentModel,ctaViewedStore:this.viewedStore});this.apiClientController=ui({configModel:this.configStore,customerCtaOptions:this.customerCTAOptions,scheduleCTA:this.scheduleCTA});this.thirdPartyApiController=Di({configModel:this.configStore});this.nonFramedCTAController=Mi({configStore:this.configStore,handleView:this.handleView,analyticsStore:this.analyticsStore,handleNavigation:this.handleNavigation,environmentModel:this.environmentModel,metricsController:this.metricsController,scheduledCTAsModel:this.scheduledCTAs,triggerOpen:this.overlayedInteractivesController.triggerOpen});this.bfCacheController=xi({environmentModel:this.environmentModel,configsStore:this.configStore});this.listenForConfigs()}init(){this.environmentModel.init();this.metricsController.init();this.previewController.init();this.responsiveController.init();this.parsedDomResults=W();this.configStore.init(this._buildConfigRequest()).then(e=>{this.processConfigResponse(e)}).catch(e=>{Vi("Error fetching configs",e)});this.embeddedInteractivesController.init({embedContainers:this.parsedDomResults.embedContainers});this.nonFramedCTAController.init({nonFramedCTAContainers:this.parsedDomResults.nonFramedCTAContainers});this.overlayedInteractivesController.init({clickTriggerButtons:this.parsedDomResults.clickTriggerButtons});this.ctaAnalyticsController.init();this.apiClientController.init();this.thirdPartyApiController.init();this.bfCacheController.init()}_buildConfigRequest(){let e=[];const{isPreview:t,previewId:i,currentUrl:n,portalId:s,env:o,hublet:r,isMobile:a,templatePath:c,versionId:l}=this.environmentModel;e=t&&i?[i]:[...this.parsedDomResults.uniqueIds];return{contentIds:e,currentUrl:n,portalId:s,env:o,hublet:r,analytics:Object.assign({},this.analyticsStore.store.state),isMobile:a,isPreview:t,templatePath:c,versionId:l}}getNavigationUrl({url:e},t){const i=new URL(e);if(!i.searchParams.has("encryptedPayload"))return e;const n=ji(e),s=this.configStore.configs.get(t);if(!s)return e;i.searchParams.set("webInteractiveId",String(s.webInteractiveId));i.searchParams.set("containerType",s.containerType);s.campaignGuid&&i.searchParams.set("campaignId",s.campaignGuid);s.contentModelId&&i.searchParams.set("webInteractiveContentId",String(s.contentModelId));s.audienceId&&i.searchParams.set("audienceId",String(s.audienceId));this.analyticsStore.analytics.hutk&&i.searchParams.set("hutk",this.analyticsStore.analytics.hutk);this.environmentModel.language&&i.searchParams.set("hsLang",this.environmentModel.language);i.searchParams.delete("encryptedPayload");return decodeURIComponent(n.encryptedPayload)===n.encryptedPayload?`${i.href}&encryptedPayload=${encodeURIComponent(n.encryptedPayload)}`:`${i.href}&encryptedPayload=${n.encryptedPayload}`}getShouldOpenNewTab(e,t){if(!this.customerCTAOptions.options.has(t))return e.openNewTab;return this.customerCTAOptions.options.get(t).openInNewTab||!1}listenForConfigs(){this.configStore.subscribe((e,t)=>{setTimeout(()=>{if(e.configs.size!==t.configs.size)for(const[e,t]of this.configStore.configs)n.GlobalIframeCommunication.broadcast(e,{type:n.MessageTypes.SEND_CTA_CONFIG,payload:Object.assign({portalId:this.environmentModel.portalId,pageUrl:this.environmentModel.currentUrl,pageTitle:document.title,gates:this.environmentModel.gates,pageId:this.environmentModel.pageId},t)})})})}processConfigResponse(e){if(e&&Array.isArray(e.gates)){Vi("Retrieved Gates from config response",e.gates);this.environmentModel.setGates(e.gates)}}}const Ui=new $i({configStore:y,environmentModel:R});window.__hsWebInteractiveInstance=Ui;var Gi=Ui;const qi=()=>!(!window.disabledHsPopups||!(window.disabledHsPopups.indexOf("LEADFLOW")>-1||window.disabledHsPopups.indexOf("CTAS")>-1))||!!window.hsInEditor;function Wi(){document.querySelectorAll(".hs-cta-embed").forEach(e=>{e.classList.add("hs-cta-embed__loaded");const t=e.querySelector(".hs-cta-loading-dot__container");t&&t.remove();const i=e.querySelector(".hs-cta-embed__skeleton");i&&i.remove()})}function zi(){Wi();new MutationObserver(e=>{for(const t of e)"childList"===t.type&&t.addedNodes.forEach(e=>{1===e.nodeType&&e instanceof HTMLElement&&e.querySelector(".hs-cta-embed")&&Wi()})}).observe(document.body,{childList:!0,subtree:!0})}const Yi=()=>{if(qi()){if(window.hsInEditor)try{zi()}catch(e){console.error("Error marking cta embed preview as loaded",e)}}else if(window.hubspot_web_interactives_running)console.error("duplicate instance of web interactives app exists");else{Gi.init();window.hubspot_web_interactives_running=!0}},Qi=()=>{Yi();document.removeEventListener("DOMContentLoaded",Qi)};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",Qi):Yi()},function(e,t,i){"use strict";var n=i(3),s=i(4);const o=(...e)=>{Object(n.a)("[GlobalIframeCommunication]",...e)};class r{constructor(){this.iframeCommunicators=new Map;this.eventEmitter=Object(s.a)();this.reset=()=>{this.eventEmitter.reset();this.iframeCommunicators=new Map}}registerHandler(e,t){this.eventEmitter.on(e,t)}registerHandlers(e){o("Registering handlers",e);Object.keys(e).forEach(t=>{const i=t,n=e[i];n&&this.registerHandler(i,n)})}registerCommunicator(e,t){o("Registering communicator",t);const i=this.iframeCommunicators.get(t)||[];this.iframeCommunicators.set(t,[...i,e])}removeCommunicator(e){o("Removing Iframe Communicator from GlobalCommunication: ",e);this.iframeCommunicators.delete(e)}emit(e,t){o("Emitting event",{event:e,messagePayload:t});this.eventEmitter.emit(e,t)}broadcast(e,t){const i=this.iframeCommunicators.get(e);if(i){o("Broadcasting",i);i.forEach(e=>{e.sendMessage(t)})}else o("Cannot find communcators array, not broadcasting",e,t)}broadcastAll(e){o("Broadcasting",e,"to all",this.iframeCommunicators);for(const[t,i]of this.iframeCommunicators)this.broadcast(t,e)}}var a=new r,c=i(1);function l(){return new MessageChannel}const h=(...e)=>{Object(n.a)("[iframeCommunication]",...e)};class d{constructor(e,t){this.queue=[];this.initialised=!1;this.events=new Map;this.eventEmitter=Object(s.a)();this.handleMessage=e=>{if(!e.data||!e.data.type)return;const{type:t,payload:i}=e.data;h("Handling message",{type:t,payload:i});this.eventEmitter.emit(t,i);a.emit(t,Object.assign({},i,{id:this.id}))};this.handleFrameLoaded=()=>{if(this.iframe.contentWindow){h("Iframe loaded",this.iframe);this.iframe.contentWindow.postMessage({type:c.a.INIT},"*",[this.channel.port2]);this.initialised=!0;this.flushQueue()}else h("Content window not there, not loading")};this.iframe=e;this.id=t;this.channel=l();this.channel.port1.onmessage=this.handleMessage;this.iframe.addEventListener("load",this.handleFrameLoaded);h("Iframe communication set up",t,e)}sendMessage({type:e,payload:t}){if(this.initialised){h("Posting message",{type:e,payload:t});this.channel.port1.postMessage({type:e,payload:t})}else{h("Queueing message",{type:e,payload:t});this.queue.push({type:e,payload:t})}}registerHandler(e,t){this.eventEmitter.off(e);this.eventEmitter.on(e,t)}registerHandlers(e){h("Registering handlers in IframeCommunication",e);Object.keys(e).forEach(t=>{const i=t,n=e[i];n&&this.registerHandler(i,n)})}removeHandler(e){h("Removing handler",e);this.eventEmitter.off(e)}remove(){h("Removing frame communicator:",this.id);this.channel.port1.close();a.removeCommunicator(this.id)}flushQueue(){if(this.initialised){h("Flushing queue",this.queue);this.queue.forEach(e=>{this.sendMessage(e)})}else h("Not flushing queue, not initialised")}}function u(e,t){h("Creating iframe communication");const i=new d(e,t);a.registerCommunicator(i,t);return i}function m(e){const t=window.location.origin.startsWith("http:")?"http://":"https://";return e.startsWith(t)?e:`${t}${e.replace(/http(s)?:\/\//,"")}`}function g(e){e.style.border="none";e.style.height="100%";e.style.width="100%";e.style.visibility="hidden"}function p(e,t){const i=document.createElement("iframe");i.src=m(e);Object.keys(t).forEach(e=>{i.setAttribute(e,t[e])});g(i);return i}var f=i(2),v=i(5);const C=(...e)=>{Object(n.a)("[FrameComponent]",...e)},T=()=>{};class b{constructor({id:e,container:t,iframeSrc:i,resizeHeight:n,onFrameReady:s,useResponsiveStyling:o,extraAttributes:r={}}){this.onFrameReady=T;this.resizeHeight=!0;this.handleHeightChange=({height:e})=>{if(!this.resizeHeight)return;const t=e+2*parseInt(getComputedStyle(this.iframe).borderTopWidth,10);C("Handle height change",this.id,{adjustedHeight:t,height:e});this.setContainerStyle({height:t+"px"})};this.id=e||1;this.resizeHeight=n;if(o){C("Responsive styling is enabled",e);i=Object(v.a)(i,"enableResponsiveStyles","true")}this.iframe=p(i,r);this.container=t;this.iframeCommunicator=u(this.iframe,e||1);s&&(this.onFrameReady=s);t.appendChild(this.iframe);this.registerHandlers()}registerHandlers(){this.iframeCommunicator.registerHandlers({[c.a.STARTED]:this.onFrameReady,[c.a.NEW_HEIGHT]:this.handleHeightChange})}setStyle(e){C("Set style",this.id,e);Object(f.a)(this.iframe,e)}setShouldResize(e){this.resizeHeight=e}setContainerStyle(e){Object(f.a)(this.container,e)}}function y(e){return new b(e)}i.d(t,"e",(function(){return u}));i.d(t,"d",(function(){return p}));i.d(t,"c",(function(){return y}));i.d(t,"b",(function(){return s.a}));i.d(t,"a",(function(){return a}))},function(e,t,i){"use strict";i(7),i(1);i(8);i(4)},function(e,t,i){"use strict";var n=i(0);const s="hubspotutk",o="__hstc",r="__hssc",a=e=>{const t=document.cookie.match(`(^|[^;]+)\\s*${e}\\s*=\\s*([^;]+)`);return t?t.pop():""},c=()=>a(s),l=()=>a(o),h=()=>a(r);var d=i(3);const u=(...e)=>{Object(d.a)("[models/Analytics]",...e)};class m{constructor(){this._handleFetchSucceded=e=>{this.store.setState(t=>{const i={};i.path=e.path;i.referrerPath=e.referrerPath;i.referrer="";i.analyticsPageId=e.pageId;i.hsfp=e._getFingerprint();i.canonicalUrl=e.canonicalUrl;i.contentType=e.contentType;i.pageId=m.getPageId()||e.pageId;e.session&&(i.hssc=e.session.get());if(e.utk){i.hstc=e.utk.get();i.hutk=e.utk.visitor}return Object.assign({},t,{},i,{isLoaded:!0})})};window._hsq=window._hsq||[];const e={isLoaded:!1,pageUrl:window.location.href,pageTitle:window.document.title,referrer:window.document.referrer,userAgent:window.navigator.userAgent,hutk:c(),hssc:h(),hstc:l(),pageId:m.getPageId()};this.store=new n.Store(e);this.fetchAnalytics()}fetchAnalytics(){this._analyticsQueue.push(this._handleFetchSucceded)}subscribe(e){return this.store.subscribe(e)}get analytics(){return this.store.state}track(e){u("Tracking analytics",e);this._analyticsQueue.push(e)}get _analyticsQueue(){return window._hsq}static getPageId(){const e=window.hsVars;return e&&e.analytics_page_id?e.analytics_page_id:e&&e.page_id?e.page_id:null}static getLanguage(){const e=window.hsVars;return e&&e.language?e.language:null}}var g=new m,p=i(22),f=i(1);const v=(...e)=>{Object(d.a)("[AnalyticsProxyController]",...e)},C=["trackFormView","trackFormVisible","trackFormInteraction"];class T{constructor({applicationController:e,analyticsStore:t}){this.viewQueue=new Map;this.applicationController=e;this.analyticsStore=t;this.listenForAnalyticsUpdate();this.listenForProxyMessage()}listenForAnalyticsUpdate(){this.analyticsStore.subscribe((e,t)=>{!t.isLoaded&&e.isLoaded&&p.a.broadcastAll({type:f.a.RECEIVED_ANALYTICS,payload:e})})}flushViewQueue(e){const t=this.viewQueue.get(e)||[];for(const e of t)this.analyticsStore.track(e);this.viewQueue.delete(e)}handleFormView(e,t){const i=this.applicationController.viewedStore;if(i&&i.hasBeenViewed(e)){this.analyticsStore.track(t);return}const n=this.viewQueue.get(e)||[];v("Adding form view to analytics queue",{id:e,analytics:t});this.viewQueue.set(e,[...n,t])}listenForProxyMessage(){p.a.registerHandlers({[f.a.PROXY_ANALYTICS]:({analytics:e,id:t})=>{T.isFormView(e)?this.handleFormView(t,e):this.analyticsStore.track(e)}})}static isFormView(e){const[t]=e;return C.includes(t)}}var b=i(9);class y{constructor({applicationController:e}){this.applicationController=e;this.listenForNavigation()}listenForNavigation(){p.a.registerHandlers({[f.a.NAVIGATE_PAGE]:({url:e,openNewTab:t,id:i})=>{const n=this.applicationController.getNavigationUrl({url:e,openNewTab:t},i),s=this.applicationController.getShouldOpenNewTab({url:e,openNewTab:t},i);Object(b.a)(n,s)}})}}i.d(t,"a",(function(){return w}));class w{constructor(){this.analyticsStore=g;this.analyticsProxyController=new T({analyticsStore:this.analyticsStore,applicationController:this});this.navigationProxyController=new y({applicationController:this})}getNavigationUrl(e,t){return e.url}getShouldOpenNewTab(e,t){return e.openNewTab}}},function(e,t,i){"use strict";class n{constructor({onTrigger:e}){this.isExitIntent=e=>{if(!e)return!1;return!e.relatedTarget&&e.clientY<100};this.handleMouseOut=e=>{this.isExitIntent(e)&&this.onTrigger(this)};this.onTrigger=e;this.setup()}setup(){document.addEventListener("mouseout",this.handleMouseOut)}remove(){document.removeEventListener("mouseout",this.handleMouseOut)}}const s=1e3,o=["mousedown","mousemove","keypress","scroll","touchstart"];class r{constructor({onTrigger:e,value:t}){this.resetTimer=()=>{this.timeout&&clearTimeout(this.timeout);this.timeout=setTimeout(()=>this.onTrigger(this),this.seconds)};this.onTrigger=e;this.seconds=t*s;this.timeout=null;this.setup()}setup(){this.timeout=setTimeout(()=>this.onTrigger(this),this.seconds);o.forEach(e=>{document.addEventListener(e,this.resetTimer)})}remove(){o.forEach(e=>{document.removeEventListener(e,this.resetTimer)});this.timeout&&clearTimeout(this.timeout)}}function a(){let e=!1;try{const t={get passive(){e=!0}};window.addEventListener("test",t,t);window.removeEventListener("test",t,t)}catch(t){e=!1}return e}function c(){return Math.max(document.body.offsetHeight,document.body.scrollHeight)}function l(e){return Math.max(e.offsetHeight,e.scrollHeight)}function h(){return Math.max(window.innerHeight||0,document.documentElement.clientHeight)}function d(){return document.body.scrollTop||document.documentElement.scrollTop}function u(e){const t=e.getBoundingClientRect(),i=window.innerHeight,n=(Math.min(t.bottom,i)-t.top)/i*100;return Math.max(0,Math.min(100,n))}const m=80;class g{constructor({onTrigger:e,value:t}){this.ungatedForMainElementScroll=!1;this.handleScroll=e=>{if(this.ungatedForMainElementScroll&&e.target!==document.body){this.checkIfElementShouldTriggerScroll(e.target);return}const t=c()-h();100*d()/t>=this.scrollPercent&&this.onTrigger(this)};this.checkIfElementShouldTriggerScroll=e=>{if(u(e)=this.scrollPercent&&this.onTrigger(this)};this.onTrigger=e;this.scrollPercent=t;this.supportsPassiveScrolling=a();this.setup()}setup(){this.supportsPassiveScrolling?window.addEventListener("scroll",this.handleScroll,{capture:!0,passive:!0}):window.addEventListener("scroll",this.handleScroll,!0)}remove(){this.supportsPassiveScrolling?window.removeEventListener("scroll",this.handleScroll,{capture:!0}):window.removeEventListener("scroll",this.handleScroll,!0)}}const p=1e3;function f(){return document.timeline&&document.timeline.currentTime?document.timeline.currentTime:performance?performance.now():0}class v{constructor({onTrigger:e,value:t}){this.onTrigger=e;const i=f();this.ms=Math.max(t*p-i,0);this.timeout=null;this.setup()}setup(){this.timeout=setTimeout(()=>{this.onTrigger(this)},this.ms)}remove(){this.timeout&&clearTimeout(this.timeout)}}i.d(t,"a",(function(){return C}));function C(e,t){const{showOnPageScroll:i,showOnExitIntent:s,showAfterDelay:o,showAfterInactivity:a,pageScrollPercentageTrigger:c,delayInSeconds:l,inactivityInSeconds:h}=e,d=[];i&&d.push(new g({onTrigger:t,value:c||0}));s&&d.push(new n({onTrigger:t}));o&&d.push(new v({onTrigger:t,value:l||0}));a&&d.push(new r({onTrigger:t,value:h||0}));return d}}]);